<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="jquery.min.js"></script>
</head>
<body>
<button id="bnt1">查所有</button>
<button id="bnt2">查单个</button>
<button id="bnt3">修改</button>
<button id="bnt4">删除</button>
<button id="bnt5">增加</button>

<script>
    $("#bnt1").click(function () {
        $.get("/users",function (data) {
            console.log(data);
        })
    })
    $("#bnt2").click(function () {
        $.get("/users/1",function (data) {
            console.log(data);
        })
    })
    $("#bnt3").click(function () {
        $.ajax({
            url: "/users",
            type: "put",
            data: {id:1,name:"ming",age:"28"},
            success:function (data) {
                console.log(data);
            }
        })
    })
    $("#bnt4").click(function () {
        $.ajax({
            url: "/users",
            type: "delete",
            success:function (data) {
                console.log(data)
            }
        })
    })
    $("#bnt5").click(function () {
        $.post("/users",function (data) {
            console.log(data);
        })
    })
</script>
</body>
</html>